package b4.widget.user
{
	import b4.model.player.*;
	import b4.net.*;
	import b4.widget.basic.*;
	
	import flash.filters.*;
	import flash.text.*;

	public class UserPane extends BasicWidget
	{
		//生命条
		public var hpBar:MaskProgressBar;
		//体力条
		public var vpBar:MaskProgressBar;
		//等级
		public var levelIcon:LevelIcon;
		
		public function UserPane()
		{
			super();
			var me:Me = PlayerManager.getInstance().me;
			//背景
			var UserPaneBgr:Class = ResourceManager.getInstance().getClassByName("UserPaneBgr");
			addChild(new UserPaneBgr());
			//名字
			var nameText:TextField = new TextField();
        	nameText.autoSize = TextFieldAutoSize.CENTER;
			nameText.defaultTextFormat = new TextFormat("微软雅黑", 14, 0xFFFFFF);
			nameText.filters = [new GlowFilter(0x000000, 1, 1.3, 1.3, 100, BitmapFilterQuality.HIGH)];
			nameText.selectable = false;
			nameText.x = 180;
			nameText.y = 5;
			nameText.text = me.name;
			addChild(nameText);
			//生命条
			var HPBar:Class = ResourceManager.getInstance().getClassByName("HealthPointBar");
			hpBar = new MaskProgressBar(HPBar);
			hpBar.percentage = 1;
			hpBar.x = 95;
			hpBar.y = 30;
			addChild(hpBar);
			//体力条
			var VPBar:Class = ResourceManager.getInstance().getClassByName("VitalityPointBar");
			vpBar = new MaskProgressBar(VPBar);
			vpBar.percentage = 0.9;
			vpBar.x = 95;
			vpBar.y = 52;
			addChild(vpBar);
//			//等级
//			levelIcon = new LevelIcon();
//			levelIcon.x = 80;
//			levelIcon.y = 80;
//			addChild(levelIcon);
		}
		
	}
}